﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace B.S.Database.Interface.Migrations
{
    public partial class _0720work : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Audit_Tables",
                columns: table => new
                {
                    AuditId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifiedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifydTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Audit_Tables", x => x.AuditId);
                });

            migrationBuilder.CreateTable(
                name: "Basic_Traceabilities",
                columns: table => new
                {
                    TraceabilityId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsId = table.Column<int>(type: "int", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Quality_Guarantee = table.Column<int>(type: "int", nullable: false),
                    Production_License = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Manufacturing_Enterprise = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Information_Completeness = table.Column<int>(type: "int", nullable: false),
                    NumberOfExports = table.Column<int>(type: "int", nullable: true),
                    Cover_Image = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Basic_Traceabilities", x => x.TraceabilityId);
                });

            migrationBuilder.CreateTable(
                name: "Breeding_Informations",
                columns: table => new
                {
                    BreedingId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Breed_Type = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Source_Origin = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Feeding_Days = table.Column<int>(type: "int", nullable: false),
                    Feed_Brand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Breeding_Supervisor = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Release_Date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Breeding_Informations", x => x.BreedingId);
                });

            migrationBuilder.CreateTable(
                name: "Company_Informations",
                columns: table => new
                {
                    CompanyId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Livestock_Farm = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Farm_Manage = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    nventory_Quantity = table.Column<int>(type: "int", nullable: true),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Corporate_Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Province = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ocation_City = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Detailed_Addres = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Establishment_Date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Company_Profile = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Company_Informations", x => x.CompanyId);
                });

            migrationBuilder.CreateTable(
                name: "Goods_Infomations",
                columns: table => new
                {
                    GoodsId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Goods_Infomations", x => x.GoodsId);
                });

            migrationBuilder.CreateTable(
                name: "Immune_Infomations",
                columns: table => new
                {
                    ImmuneId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Feeding_Days = table.Column<int>(type: "int", nullable: false),
                    Immune_System = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Immune_Methods = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Production_Bath = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Immune_Infomations", x => x.ImmuneId);
                });

            migrationBuilder.CreateTable(
                name: "Picture_Informations",
                columns: table => new
                {
                    PictureId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Inspection_Repor = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Livestock_Certification = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Certification_Documents = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Food_Safety = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Raw_Material = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Auxiliary_Materials = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Additive_Materials = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Packaging_Materials = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Enterprise_Image = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Picture_Informations", x => x.PictureId);
                });

            migrationBuilder.CreateTable(
                name: "Processing_Infomations",
                columns: table => new
                {
                    ProcessingId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Corporate_Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Production_License = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Work_Team = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Responsible_Person = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Processing_Infomations", x => x.ProcessingId);
                });

            migrationBuilder.CreateTable(
                name: "Slaughter_Informations",
                columns: table => new
                {
                    SlaughterId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch_No = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Average_Weight = table.Column<int>(type: "int", nullable: false),
                    Arrival_Time = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Slaughter_Time = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Slaughter_Informations", x => x.SlaughterId);
                });

            migrationBuilder.CreateTable(
                name: "Suppliers",
                columns: table => new
                {
                    SupplierId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DeepType = table.Column<int>(type: "int", nullable: false),
                    Batch_Number = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Suppliers", x => x.SupplierId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Audit_Tables");

            migrationBuilder.DropTable(
                name: "Basic_Traceabilities");

            migrationBuilder.DropTable(
                name: "Breeding_Informations");

            migrationBuilder.DropTable(
                name: "Company_Informations");

            migrationBuilder.DropTable(
                name: "Goods_Infomations");

            migrationBuilder.DropTable(
                name: "Immune_Infomations");

            migrationBuilder.DropTable(
                name: "Picture_Informations");

            migrationBuilder.DropTable(
                name: "Processing_Infomations");

            migrationBuilder.DropTable(
                name: "Slaughter_Informations");

            migrationBuilder.DropTable(
                name: "Suppliers");
        }
    }
}
